// import { config } from '@alilc/lowcode-engine';

let MUJI_APP_DEPLOY_ENV: string = process.env.ENV || 'dev';

// console.log('APP_NEST', process.env.APP_NEST);

// config.onceGot('env').then(value => {
//   console.log(`env全局配置改变了： ${value}`);
//   MUJI_APP_DEPLOY_ENV = value;
// });

const devHost = '//localhost:3000';
const prepubHost = '//localhost:3000';
const prodHost = '//localhost:3000';

export function getApiBase(): any {
  console.log('MUJI_APP_DEPLOY_ENV', MUJI_APP_DEPLOY_ENV);
  return (
    {
      dev: {
        base: `${devHost}/base`, // 基础模块
        user: `${devHost}/user`, // 用户模块
      },
      prepub: {
        base: `${prepubHost}/base`, // 基础模块
        user: `${prepubHost}/user`, // 用户模块
      },
      prod: {
        base: `${prodHost}/base`, // 基础模块
        user: `${prodHost}/user`, // 用户模块
      },
    } as any
  )[MUJI_APP_DEPLOY_ENV]
};
